﻿@model IEnumerable<EventSys.BussinesEntities.Ambiente>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>AMBIENTES</h2>

<p>
    @Html.ActionLink("Nuevo", "Create")
</p>

@using (Html.BeginForm())
{
    <fieldset>
        <legend></legend><b>Ingrese Ubicacion:</b> 
        <input type="search" name="criterio" value="" placeholder="Ingrese Descripcion"/>
        <input type="submit" name="buscar" value="Buscar" class="k-button"/>
    </fieldset>
}


<div class="CSSTableGenerator">
<table style="width:500px">
    <tr>
        @*<th>
            @Html.DisplayNameFor(model => model.idAmbiente)
        </th>*@
        <th>
            @Html.DisplayNameFor(model => model.Ubicacion)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Descripcion)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
       @* <td>
            @Html.DisplayFor(modelItem => item.idAmbiente)
        </td>*@
        <td>
            @Html.DisplayFor(modelItem => item.Descripcion)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Ubicacion.Descripcion)
        </td>
        <td>
            @Html.ActionLink("Editar", "Edit", new { id=item.idAmbiente }) |
           @* @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |*@
            @Html.ActionLink("Eliminar", "Delete", new {id=item.idAmbiente },
            new {onClick="return confirm('Desea Eliminar Ambiente:"+@item.Descripcion+"?');" })
        </td>
    </tr>
}
    
</table>
